<?php

namespace App;

use Illuminate\Support\Facades\DB;
use Illuminate\Database\Eloquent\Model;

class meter extends Model
{
    public static function getSignMeter($u_id){
        return DB::table('user_sign')->where([
            ['u_id','=',$u_id]
        ])->orderBy('time','desc')->first();
    }
    public static function meterSignInsert($u_id,$meter){
        return DB::table('user_sign')->where([
            ['u_id'=>$u_id]
        ])->insert(
            ['u_id'=>$u_id,'meters'=>$meter,'time'=>date('Y-m-d',time())]
        );
    }
}
